import { Document, FolderOpened } from '@element-plus/icons-vue'
import { createRouter } from '@naturefw/ui-elp'

import home from '../views/home.vue'

// import list from '../views/data-list.vue'

// import list from '../views/plat/p02-table.vue'

/**
 * 基类的测试
 * * 对象、数组、综合
 * option 风格的状态
 * setup风格的状态
 * 全局状态
 * 局部状态
 * 
 */

const baseUrl = (document.location.host.includes('.gitee.io')) ?
  '/nf-rollup-state' :  ''

export default createRouter({
  /**
   * 基础路径
   */
  baseUrl: baseUrl,
  /**
   * 首页
   */
  home: home,

  menus: [
    {
      menuId: '1000',
      title: '基类',
      naviId: '0',
      path: 'base',
      icon: FolderOpened,
      childrens: [
        {
          menuId: '1110',
          title: '数组',
          path: 'array',
          icon: Document,
          component: () => import('../views/base-class/10-base-array.vue')
        },
        {
          menuId: '1120',
          title: '初始值是对象',
          path: 'object',
          icon: Document,
          component: () => import('../views/base-class/12-base-object.vue')
        },
        {
          menuId: '1130',
          title: '初始值是函数',
          path: 'objectfun',
          icon: Document,
          component: () => import('../views/base-class/12-base-object2.vue')
        },
        {
          menuId: '1140',
          title: '表单',
          path: 'model',
          icon: Document,
          component: () => import('../views/base-class/15-base-model.vue')
        },
        {
          menuId: '1180',
          title: '定义子类',
          path: 'sonclass',
          icon: Document,
          component: () => import('../views/base-class/20-son-class.vue')
        },
        {
          menuId: '1190',
          title: 'option 风格',
          path: 'option-state',
          icon: Document,
          component: () => import('../views/base-class/30-base-state.vue')
        },
        {
          menuId: '1200',
          title: 'setup 风格',
          path: 'setup-state',
          icon: Document,
          component: () => import('../views/base-class/40-setup-state.vue')
        },
        {
          menuId: '1210',
          title: '测试',
          path: 'class-test',
          icon: Document,
          component: () => import('../views/base-class/50-class.vue')
        }
      ]
    },
    {
      menuId: '3000',
      title: 'setup风格',
      naviId: '0',
      path: 'setup',
      icon: FolderOpened,
      childrens: [
        /*
        {
          menuId: '3010',
          title: '局部状态',
          path: 'local',
          icon: Document,
          component: () => import('../views/setup/10-loacal.vue')
        },
        {
          menuId: '3020',
          title: '多次加载',
          path: 'local-reload',
          icon: Document,
          component: () => import('../views/setup/10-loacal.vue')
        },
        {
          menuId: '3030',
          title: '全局状态',
          path: 'global2',
          icon: Document,
          component: () => import('../views/setup/20-global.vue')
        },
        {
          menuId: '3040',
          title: '多次加载',
          path: 'global2-reload',
          icon: Document,
          component: () => import('../views/setup/20-global.vue')
        },*/
        {
          menuId: '3050',
          title: '递归加载组件',
          path: 'digui',
          icon: Document,
          component: () => import('../views/setup/30-digui.vue')
        }
      ]
    },
    {
      menuId: '5000',
      title: 'option风格',
      naviId: '0',
      path: 'option',
      icon: FolderOpened,
      childrens: [
        {
          menuId: '5001',
          title: '全局状态',
          path: 'state-all',
          icon: Document,
          component: () => import('../views/option/10-state-all.vue')
        },
        {
          menuId: '5002',
          title: '局部状态',
          path: 'state-local',
          icon: Document,
          component: () => import('../views/option/20-state-local.vue')
        },
        {
          menuId: '5010',
          title: '纯state',
          path: 'state',
          icon: Document,
          component: () => import('../views/state-global/10-state.vue')
        },
        {
          menuId: '5020',
          title: '一般的状态',
          path: 'standard',
          icon: Document,
          component: () => import('../views/state-global/20-standard.vue')
        },
        {
          menuId: '5040',
          title: '日志',
          path: 'log',
          icon: Document,
          component: () => import('../views/state-global/40-log.vue')
        },
        {
          menuId: '5050',
          title: '组件里定义',
          path: 'comp-reg',
          icon: Document,
          component: () => import('../views/state-global/50-comp.vue')
        }
      ]
    },
   
    
    {
      menuId: '8000',
      title: 'pinia',
      naviId: '0',
      path: 'pinia',
      icon: FolderOpened,
      childrens: [
        {
          menuId: '8010',
          title: '试一试',
          path: 'test',
          icon: Document,
          component: () => import('../views/pinia/pinia.vue')
        }
      ]
    }
  ]
})
